package Year22_Month01.day0123;

public class Solution {
    public int removeElement(int[] nums, int val) {
        int fast = 0;
        int slow = -1;
        while (fast++ < nums.length) {
            if (nums[fast] != val) {
                nums[slow++] = nums[fast];
            }
        }
        return slow + 1;
    }

    public int romanToInt(String s) {
        int index = 0;
        int result = 0;
        while (index + 1 < s.length()) {
            switch (s.charAt(index)) {
                case 'I':
                    result = 1;
                    break;
                case 'V':
                    result = 5;
                    break;
                case 'X':
                    result = 10;
                    break;
                case 'L':
                    result = 50;
                    break;
                case 'C':
                    result =100;
                    break;
                case 'D':
                    result = 500;
                    break;
                case 'M':
                    result =1000;
                    break;
            }

        }
        return 0;
    }
}
